package com.wq.wrongquestion.serviceimpl.his;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wq.wrongquestion.entity.his.HistoryEntity;
import com.wq.wrongquestion.mapper.his.HistoryMapper;
import com.wq.wrongquestion.service.his.HistoryService;

@Component
public class HistoryServiceimpl implements HistoryService {
    
    @Autowired
    public HistoryMapper HistoryMapper;
    @Override
    @Transactional
    public String getHistoryZjnm(String zjID) {
        String zjNm=HistoryMapper.getHistoryZjnm(zjID);
        return zjNm;
    }
    @Override
    @Transactional
    public List<String> getHistoryZjID() {
       List<String> allZjID=HistoryMapper.getHistoryZjID();
       return allZjID;
    }
    @Override
    @Transactional
    public List<String> getHistoryZj() {
        List<String> zjInfo=HistoryMapper.getHistoryZj();
        return zjInfo;
    }
    @Override
    @Transactional
    public void insHistory(HistoryEntity HistoryEntity) {
        HistoryMapper.insHistory(HistoryEntity);
    }
    @Override
    @Transactional
    public PageInfo<HistoryEntity> getHistory(Integer pageNumer,Integer pageSize,HistoryEntity HistoryEntity) {
        PageHelper.startPage(pageNumer, pageSize);
        List<HistoryEntity> History=HistoryMapper.getHistory(HistoryEntity);
        PageInfo<HistoryEntity> pageHistory=new PageInfo<>(History);
        return pageHistory;
    }

    @Override
    @Transactional
    public List<HistoryEntity> getHistoryByID(Integer id) {
        List<HistoryEntity> History=HistoryMapper.getHistoryByID(id);
        return History;
    }
    @Override
    @Transactional
    public Integer updHistory(HistoryEntity HistoryEntity) {
        return HistoryMapper.updHistory(HistoryEntity);
    }
    @Override
    @Transactional
    public Integer delHistory(Integer id) {
        return HistoryMapper.delHistory(id);
    }
    
}
